﻿#include "TcpCodec_TurnTable.h"

#include "TcpCodec.h"
#include "TurnTableCodec.h"

TcpCodec_TurnTable::TcpCodec_TurnTable()
{
  setObjectName(getClassNameFirstLow<TcpCodec_TurnTable>());
}

TcpCodec_TurnTable::~TcpCodec_TurnTable()
{
}

void TcpCodec_TurnTable::decode(DataPackage_TcpCodec* dataPackageInfo_User)
{
  turnTableCodec->decode(dataPackageInfo_User->getData());
}

TcpCodec* TcpCodec_TurnTable::getTcpCodec()const
{
  return tcpCodec;
}

TcpCodec_TurnTable* TcpCodec_TurnTable::setTcpCodec(TcpCodec* const tcpCodec)
{
  this->tcpCodec=tcpCodec;
  tcpCodec->addToCodecMap(TcpCodec_TurnTable::TurnTable,this);
  printInjection(this,tcpCodec);
  return this;
}

TurnTableCodec* TcpCodec_TurnTable::getTurnTableCodec()const
{
  return turnTableCodec;
}

TcpCodec_TurnTable* TcpCodec_TurnTable::setTurnTableCodec(TurnTableCodec* const turnTableCodec)
{
  this->turnTableCodec=turnTableCodec;
  printInjection(this,turnTableCodec);
  return this;
}

void TcpCodec_TurnTable::objectAutoInjection(QHash<QString,QObject*>* objMap)
{
  setTcpCodec(getObjFromMap<TcpCodec>(objMap));
  setTurnTableCodec(getObjFromMap<TurnTableCodec>(objMap));
}
